package com.demo.web.modules.hmi;

import com.demo.common.constant.api.HmiBasicVOAPIConstant;
import com.demo.common.result.ResponseInfo;
import com.demo.common.result.ResultVo;
import com.demo.service.hmi.HmiBasicVOService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hmi/basic_vo")
public class HmiBasicVOController {
    @Autowired
    private HmiBasicVOService myService;

    @GetMapping("/test")
    public String test(){
        return "hello, you are in HmiBasicVO test!";
    }

    //字典分类树
    @RequestMapping(value = HmiBasicVOAPIConstant.HMI_DICTIONARY_TYPE_VO_TREE)
    public ResultVo getDictionaryTypeVOTree(){
        return ResponseInfo.<Object>success(myService.getDictionaryTypeVOTree());
    }

    //组件分类树
    @RequestMapping(value = HmiBasicVOAPIConstant.HMI_COMPONENT_TYPE_VO_TREE)
    public ResultVo getComponentTypeVOTree(){
        return ResponseInfo.<Object>success(myService.getComponentTypeVOTree());
    }

}
